#include <bits/stdc++.h>
using namespace std;
int T,n;
const int maxn=1e6+10;
string now,ans;
bool flag;
int b[maxn],a[maxn];
int head,tail;
void search(int step)
{
//	for(int i=1;i<=step-1;i++)printf("%d ",b[i]);
	if(step==2*n+1)
	{
		cout<<now<<endl;
		flag=1;
	}
	string nxt=now;
	now+="L";
	b[step]=a[head++];
	if(step>n)
		{if(b[step]==b[2*n+1-step])search(step+1);}
	else search(step+1);
	if(flag)return;
	head--;
	now=nxt;
	now+="R";
	b[step]=a[tail--];
	if(step>n){if(b[step]==b[2*n+1-step])search(step+1);}
	else search(step+1);
	tail++;
}
void solve()
{
	scanf("%d",&n);
	for(int i=1;i<=2*n;i++)scanf("%d",&a[i]);
	head=1,tail=2*n;
	flag=0;
	ans="",now="";
	search(1);
	if(flag==0)printf("-1\n");
}
int main()
{
	freopen("palin.in","r",stdin);
	freopen("palin.out","w",stdout);
	scanf("%d",&T);
	while(T--)
		solve();
}
